<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <main>
      <span>houdunwang</span>
      <span>hdcms.com</span>
      <span>houdunren.com</span>
    </main>
  </body>
</html>

<script>
  // h4 描红 后盾人-
  const main = document.querySelector("main");
  const reg = /<span>([\s\S]+?)<\/span>/gi;
  //   必须让问号跟着加号走，否则会匹配到最后一个span
  main.innerHTML = main.innerHTML.replace(reg, (v, p1) => {
    return `<h4 style="color:red">后盾人——${p1} </h4>`;
  });
</script>
